package ar.edu.sovietrussia.customcomponents.login;

import org.apache.wicket.authroles.authentication.panel.SignInPanel;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;

/**
 * Depicts a logging error
 */
public class ErrorInLoggingComponent extends Panel {

    private static final long serialVersionUID = -7665607974642677021L;

    public ErrorInLoggingComponent(final String id, final SignInPanel signInPanel) {
        super(id);

        Form<String> form = new Form<String>("errorInLoggingForm");

        form.add(new Label("sorryNoLoggingLabel", "Autenticacion fallida"));

        form.add(new Button("back_button") {

            private static final long serialVersionUID = 4023700151509257266L;

            @Override
            public void onSubmit() {
                ErrorInLoggingComponent.this.replaceWith(signInPanel);
            }
        });

        this.add(form);

    }

}
